package com.xbs.utils;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.xbs.controller.base.BaseServlet;
import com.xbs.service.content.PayService;
/**
 * 支付
 * @author 余凯
 *
 */
@WebServlet("/ajaxpay")
public class AjaxPayServlet extends BaseServlet {
	private PayService ps;
	public AjaxPayServlet() {
		ps = new PayService();
	}
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		//获取当前用户的身份证号码
		String did = req.getParameter("did");
		//获取用户输入的支付密码
		String dpwd = req.getParameter("dpwd");
		System.out.println(dpwd);
		
		//获取数据库中该用户的支付密码
		String pwd = ps.selPwd(did);
		System.out.println(pwd);
		String str="";
		if(dpwd.equals(pwd)){
			
			str="true";
		}else{
			str="false";
		}
		resp.getWriter().print(str);
	}
}
